Skip to content

Conversation

weswigham
Copy link
Member

The diagnostic message got updated to include node16 when we updated node12 to node16, but the offending condition in the code to trigger the diagnostic never got updated to account for node16.

Fixes #50653

@weswigham weswigham merged commit f46a680 into microsoft:main Sep 8, 2022
@fatcerberus
Copy link

...the offending condition in the code to trigger the diagnostic never got updated to account for node16.

I kind of figured this is what happened. 😄

That being said, this condition:

if (moduleKind !== ModuleKind.ESNext && moduleKind !== ModuleKind.NodeNext && moduleKind !== ModuleKind.Node16)

It seems backwards. It feels like this should instead be a set of cases where the error is meant to be issued rather than the cases where it's not; it's safe to assume the feature will be supported by any new targets going forwards. In other words it'd be nice to future-proof the check to prevent this bug from happening again in the future.

@andrewbranch andrewbranch added this to the TypeScript 4.8.4 milestone Sep 12, 2022
@andrewbranch
Copy link
Member

@typescript-bot cherry-pick this to release-4.8

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 12, 2022

Heya @andrewbranch, I've started to run the task to cherry-pick this into release-4.8 on this PR at 3d0e834. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

Hey @andrewbranch, I've opened #50742 for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"module": "node16" gives contradictory error about import assertions
4 participants